<?php
/* Smarty version 3.1.31, created on 2018-04-04 09:12:05
  from "/opt/lampp/htdocs/pro/app/view/admin/login.html" */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.31',
  'unifunc' => 'content_5ac47ac56aa557_82509389',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '8a1e13188b465c656ea17f41edb3a4f39ba96989' => 
    array (
      0 => '/opt/lampp/htdocs/pro/app/view/admin/login.html',
      1 => 1522825914,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_5ac47ac56aa557_82509389 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_loadInheritance();
$_smarty_tpl->inheritance->init($_smarty_tpl, false);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>TCP后台管理系统</title>
    <?php 
$_smarty_tpl->inheritance->instanceBlock($_smarty_tpl, 'Block_6755901055ac47ac5686403_40792499', "css");
?>

</head>
<body>
<div style="width:300px;position: relative;top: 50%;margin: 0 auto;transform: translateY(-50%);"
     class="portlet form-bg ui-widget ui-widget-content ui-helper-clearfix ui-corner-all">
    <div class="portlet-header ui-widget-header">TCP后台管理系统</div>
    <div class="portlet-content">
        <form id="loginfrom" class="forms" name="form">
            <ul>
                <li>
                    <label class="desc">
                        账号:
                    </label>
                    <div>
                        <input type="text" tabindex="1" maxlength="255" class="field text full" name="username">

                    </div>
                </li>
                <li>
                    <label class="desc">
                        密码:
                    </label>
                    <div>
                        <input type="password" tabindex="1" maxlength="255" class="field text full" name="pwd">
                    </div>
                </li>
                <li class="buttons">
                    <input type="hidden" name="tk_name" value="<?php echo $_smarty_tpl->tpl_vars['tk_name']->value;?>
"/>
                    <input type="hidden" name="tk_value" value="<?php echo $_smarty_tpl->tpl_vars['tk_value']->value;?>
"/>
                    <?php if ($_smarty_tpl->tpl_vars['is_create']->value == 1) {?>
                    <button type="button" attr_url="/api/checklogin.json" class="ui-state-default ui-corner-all frombtn"
                            onclick="dofrom(this)">登录
                    </button>
                    <?php } else { ?>
                    <button type="button" attr_url="/api/createaccount.json"
                            class="ui-state-default ui-corner-all frombtn" onclick="dofrom(this)">创建账号
                    </button>
                    <?php }?>
                </li>
            </ul>

        </form>


    </div>
</div>
<?php echo '<script'; ?>
 type="text/javascript" src="/js/jquery-1.3.2.js"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
 type="text/javascript" src="/js/jquery-ui-1.7.2.js"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
 type="text/javascript" src="/js/md5.js"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
 type="text/javascript" src="/js/jquery.toastmessage.js"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
 type="text/javascript" src="/js/common.js"><?php echo '</script'; ?>
>

<?php echo '<script'; ?>
 type="text/javascript">
    $(document).keyup(function (event) {
        if (event.keyCode == 13) {
            $(".frombtn").click();
        }
    });
    function dofrom(obj) {
        var tk_name = $("input[name='tk_name']").val();
        var tk_value = $("input[name='tk_value']").val();
        var username = $("input[name='username']").val();
        var pwd = $("input[name='pwd']").val();

        if (!isNull(username)) {
            showmsg('请输入账号', 2);
            return false;
        }
        if (!isNull(pwd)) {
            showmsg('请输入密码', 2);
            return false;
        }

        var xhr = new XMLHttpRequest();
        var fdata = new FormData();
        fdata.append('tk_name', tk_name);
        fdata.append('tk_value', tk_value);
        fdata.append('username', username);
        fdata.append('pwd', md5str(pwd));
        xhr.open('POST', obj.getAttribute('attr_url'), true);
        xhr.send(fdata);
        xhr.onreadystatechange = function () {
            if(xhr.readyState==4){
                if (xhr.status == 200) {
                    showmsg(xhr.responseText, 1);
                    setTimeout("goback('/admin/index')", 1500);
                } else {
                    showmsg(xhr.responseText, 4);
                    dorefulsh();
                }
            }

        }


    }

<?php echo '</script'; ?>
>

</body>
</html><?php }
/* {block "css"} */
class Block_6755901055ac47ac5686403_40792499 extends Smarty_Internal_Block
{
public $subBlocks = array (
  'css' => 
  array (
    0 => 'Block_6755901055ac47ac5686403_40792499',
  ),
);
public function callBlock(Smarty_Internal_Template $_smarty_tpl) {
?>

    <link href="/css/style.css" rel="stylesheet" media="all"/>
    <?php
}
}
/* {/block "css"} */
}
